<script src="./axios.js"></script>
<script>


    let p1 = new Promise((resolve,reject)=>{
        setTimeout(()=>{
            reject(10)
        }, 10)
    })
    let p2 = new Promise((resolve,reject)=>{
        setTimeout(()=>{
            reject(1)
        }, 1000)
    })
    let p3 = axios.get('http://ajax-api.itheima.net/api/province111')

    let p = Promise.race([p1, p2, p3])
    // Promise.race 返回一个新的promise对象
    // 看哪个先成功|失败

    p.then(res=>{
        console.log(res)
    }).catch(err=>{
        console.log('err', err)
    })
    // console.log(p)
</script>